#include "ScreenManager.h"
#include "StartScreen.h"

ScreenManager * ScreenManager::instance = NULL;

ScreenManager::ScreenManager(void)
{
	newScreen = new StartScreen();
	hasScreenChanged = true;
}

ScreenManager * ScreenManager::Instance()
{
	if ( instance == NULL )
		instance = new ScreenManager();

	return instance;
}

ScreenManager::~ScreenManager(void)
{
}

void ScreenManager::ChangeScreen(Screen * newScreen)
{
	//Post the screen to get changed at the next update cycle
	this->newScreen = newScreen;
	this->hasScreenChanged = true;
}

bool ScreenManager::HasScreenChanged()
{
	return this->hasScreenChanged;
}

Screen * ScreenManager::GetNewScreen()
{
	this->hasScreenChanged = false;
	return this->newScreen;
}
